// @flow
import React from 'react';
import { connect } from 'react-redux';
import { type State } from 'models';
import { Alert } from 'antd';

type Props = {
  errorMessage: string,
  isError: boolean,
  landing: boolean,
  fullscreenLoader: boolean,
};
class AuthContainer extends React.Component<Props> {
  render() {
    const { errorMessage, isError, landing, fullscreenLoader } = this.props;
    return (
      <React.Fragment>
        {isError ? <Alert type="error" message={errorMessage} banner /> : null}
      </React.Fragment>
    );
  }
}
const mapStateToProps = ({ base }: State) => ({
  errorMessage: base.errorMessage.text,
  isError: base.errorMessage.isError,
  landing: base.landing,
  fullscreenLoader: base.fullscreenLoader,
});

const mapDispatchToProps = () => ({});
export default connect(
  mapStateToProps,
  mapDispatchToProps,
)(AuthContainer);
